<template>
  <border-box>
    <div slot="content"
         class="visual-data-box">
      <div class="title">
        <span class="text">{{title}}</span>
      </div>
      <div class="content">
        <slot name="content" />
      </div>
    </div>
  </border-box>
</template>

<script>
import BorderBox from './BorderBox';

export default {
  components: {
    'border-box': BorderBox,
  },

  props: {
    title: {
      type: String,
      default: () => '',
    },
  },
};
</script>

<style lang="less" scoped>
.visual-data-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  > .title {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    .text {
      width: 100%;
      flex: 0 0 36px;
      line-height: 36px;
      padding: 0 16px;
      border-radius: 4px;
      display: block;
      font-size: 18px;
      font-weight: 700;
      color: #ffffff;
      background-image: linear-gradient(
        to right,
        rgb(0, 114, 255),
        rgba(0, 114, 255, 0)
      ) !important ;
    }
  }
  > .content {
    flex: 1;
    overflow: hidden;
    background-color: rgb(16, 47, 111);
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
  }
}
</style>